package cn.ad.server.persistence;

import javax.annotation.Resource;

import cn.ad.server.common.Constants;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.stereotype.Repository;

import cn.ad.server.domain.ad.AdTemplate;

@Repository
public class AdTemplateRepositoryImp implements AdTemplateRepository {

	@Resource(name = "cacheRedisTemplate")
	private HashOperations<String, String, AdTemplate> adTemplateValueOperations;

	@Override
	public AdTemplate fetchTemplateByTagId(String tagId) {
		return adTemplateValueOperations.get(Constants.TAG_TABLE_REDIS, tagId);
	}

}
